package com.example.tool;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Mysqlconnect {
	public static Connection getCon(String DBname, String id, String password) {
		String uri = "jdbc:mysql://数据库地址:3306/" + DBname + "?useSSL=true&characterEncoding=utf-8&useUnicode=true";
		Connection con = null;
		try {
			con = DriverManager.getConnection(uri, id, password);
		} catch (SQLException throwables) {
			throwables.printStackTrace();
		}
		return con;
	}
}
